home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Message-ID: <22102BA1H000B4AA1H@ag01.bbrandes.berlinet.de>
- From: A.GUMTOW@BBrandes.berlinet.de (Andreas Gumtow)
- Path: tbx.berlinet.de!bbrandes.berlinet.de
- Subject: Re: The easiest C Program ever!!
- Date: Sat, 10 Feb 1996 08:51:29 +0100
- X-Mailer: -- The Answer V3.06ss7 (public Beta 1)
- References: <311.6610T1012T295@in.net>
- X-Gateway: ZCONNECT zelator.berlinet.de [LEGO v0.09]
- X-ZC-PGP-KEY-AVAIL:
-
- On Di 06.02.1996 at 22:51:49 wrote mave@in.net (John J. Maver, Jr.)
- in Message "The easiest C Program ever!!":
-
-
- JJ MJ)> How do I do a "Press enter to continue" in plain old ANSI C? I have
- JJ MJ)> got SAS6.56.
- JJ MJ)>
- JJ MJ)> My guess was:
- JJ MJ)>
- JJ MJ)>
- JJ MJ)> printf("Please press enter to continue\n");
- JJ MJ)> while ((c=getchar()) != '\n' )
- JJ MJ)> ;
- JJ MJ)>
- JJ MJ)>
- JJ MJ)> However, it never gets the character.
-
- Try:
- ---***---
- #include <stdio.h>
-
- main()
- {
- char *c;
- printf("Press Enter to continue !\n");
- c=getchar(); ; alter: repeat
- while(c=="\n") ; until((c=getchar())=="\n")
- {
- c=getchar();
- }
- }
- ---***---
-
-
-
- CU
- Andreas
-
-
- "That must be wonderful! I don't understand it at all."
-
-